﻿
-- =============================================
-- Author:		<Author,XFL>
-- Edit date: <Create Date,2012 02 01>
-- Description:	<Description, 
-- [人资管理]-[员工工资管理]
-- 相对原来的项目来说 多出一个 其他补助字段 QtAllowance，同时固定补助地段也已经统一
-- =============================================
CREATE PROCEDURE [dbo].[proc_Wage_GetItem_BYUserId]
	(
		@UserId VARCHAR(20)
	)
AS
		Select
		Id
		,GId
		,UserName
		,EName
		,CompanyId
		,(Select CompanyName From Company Where Id=Employee_Wage.CompanyId) As CompanyName
		,DepartmentId
		,DepName
		,ZhiWu
		,GradeId
		,GradeName
		,PostCategoryId
		,PostCategoryName
		,PostId
		,PostName
		,ChuQinDays
		,BasicWage
		,PostWage
		,WorkWage
		,JxWage
		,Jxyuan
		,Jxkou
		,ManQin
		,Allowance
		,FixedAllowance as FAllowance
		,QtAllowance
		,TiCheng
		,MTiCheng
		,YjBonus
		,LsBonus
		,ChuQinKouKuan
		,BxKouKuan
		,ChiDaoKouKuan
		,YJKouKuan
		,OtherKouKuan
		,FaFangMonth
		,CreateName
		,CreateDate
		,HRFlag
		,ISNULL(HRFlagDate,'1900-01-01') As HRFlagDate
		,FinanceFlag
		,ISNULL(FinanceFlagDate,'1900-01-01') As FinanceFlagDate
		,isnull(HeJiWage,0) HeJiWage
		,isnull(XSTC,0) XSTC, isnull(XFTC,0) XFTC, isnull(BLTC,0) BLTC, 
		 isnull(LSwance,0) LSwance, isnull(ZBwance,0) ZBwance, 
		 isnull(GJJKouKuan,0) GJJKouKuan, 
		 isnull(GRSDSKouKuan,0) GRSDSKouKuan, isnull(YFHeJi,0) YFHeJi, isnull(DFHeJi,0) DFHeJi, 
		 FinanceFlagDate_DF, isnull(FinanceFlag_DF,1) FinanceFlag_DF,isnull(Deduction,0) as Deduction
		From Employee_Wage WHERE UserName =@UserId order by FaFangMonth
	RETURN




